package Boundary;

import DataView.Action;
import DataView.Expr;
import Executor.Main;
import Interfaces.SM_examinate;
import Interfaces.showProject;
import Store.Row;
import Visualization.ProjectVis;

public class UpdateProject extends BaseBoundary 
{
	public showProject home;
	public Main main;
	public ProjectVis project;

	public UpdateProject(Main main) 
	{
		this.main=main;
		home = new showProject(main.easySM.interfaces);
	}

	public void mkOpenProject(ProjectVis Pr) 
	{
		project=Pr;
		home.init(this);
	}

	public void setProject(ProjectVis aPr) 
	{
		project=aPr;
		home.display(null, true);
	}

	public void closeProject() 
	{
		main.doClose();
	}

	public void openInputCD() 
	{
		main.doOpenInputCD();
	}

	public void openSOINV() 
	{
		main.doOpenSOINV();
	}

	public void openEVCR() {
		main.doOpenEVCR();
	}

	public void openST() 
	{
		main.doOpenST();
	}

	public void generateSM() 
	{
		main.doGenerateSM();
	}

	public void done() 
	{
		setProject(main.OPEN_PRJ.vis());
	}

	public void examine(Row source, Expr cond, Action act) 
	{
		home.display(new SM_examinate(this).examinate(source, cond, act), false);
	}

	public void answer(boolean ok, Row target) 
	{
		if(ok)
			main.ok(target);
		else main.doExamine_aux();
	}
}